package com.hnucm.cooklife.base.utils;

import com.hnucm.cooklife.bean.db.DishDetail;

import org.codehaus.jackson.map.ObjectMapper;

import java.util.Map;

public class ObjectToMapExample {

    public static Map<String,Object> convert(DishDetail dishDetail) {

        ObjectMapper oMapper = new ObjectMapper();

//        DishDetail obj = new DishDetail();

        // object -> Map
        Map<String, Object> map = oMapper.convertValue(dishDetail, Map.class);

        return map;
    }
}